# -*- coding: utf-8 -*-
import sys
from nltk.corpus import wordnet as wn  
 
#zwraca listę synonimów (elemety synsetów dla wszystkich synsetów)
def synonims(word):
    list = set()
    syns = wn.synsets(word)
    for syn in syns:
        for lemma in syn.lemmas:
            list.add(lemma.name)

    print list
    return list

#wywietla hieraarchie synsetów
def magic(word):
    print word+'\n'
    
    syns = wn.synsets(word)
    for syn in syns:
#         print syn.name 
#         for  rh in syn.root_hypernyms():
#             print rh.name
        print syn.name + syn.definition
        for hp in syn.hypernym_paths():
            for h in hp:
                print h.name +' -> ', 
            print 'X'
        lemma_names =  syn.lemma_names
        for lemma in lemma_names:
            print lemma
        print '*****************************'

    
synonims('powódź')